<#include "/@inc/funcMacros.ftl">
<#include "/@inc/copyright.txt">
<#assign baseName = TriaGram + Prefix + LateType>
<#assign className = baseName + "Test">
<@pp.renameOutputFile name=className + ".cpp">
</@pp.renameOutputFile>

#include "${className}.h"

${className}::${className}():
NEOUtlCmdLineParser()
{
}

${className}::~${className}(void)
{
}

int ${className}::Run(int arg, char * argv[])
{
	int rc = NEOUtlCmdLineParser::Run(arg, argv) ;

  <#list Attributes as attrib>
    rc = Parse${attrib.name}() ;
  </#list>

	rc = Execute() ;

	return rc ;
}

int ${className}::Execute()
{
	int rc = -1 ;

	// Call Update on Feature

	return rc ;
}

<#list Attributes as attrib>
<#list Types as t> <#if t.tk_type == attrib.type> <#assign x = t> <#break> </#if> </#list>

int ${className}::${attrib.name}()
{
	int rc = -1 ;
<#switch attrib.type>
<#case "tk_integer">
	int n${attrib.name} = GetArg("-${attrib.name}") ;

	rc = _spFeature->Set${attrib.name}(n${attrib.name}) ;
<#break>
<#case "tk_double">
<#case "tk_param_length">
<#case "tk_param_angle">
<#case "tk_param_real">
	double d${attrib.name} = GetArg("-${attrib.name}") ;

	rc = _spFeature->Set${attrib.name}(d${attrib.name}) ;
<#break>
<#case "tk_string">

	CATUnicodeString str = GetArg("-${attrib.name}") ;

	rc = _spFeature->Set${attrib.name}(str) ;
<#break>
<#case "tk_component">
<#case "tk_specobject">
	CATUnicodeString str = GetArg("-${attrib.name}") ;

	// find the string in the Part
	CATISpecObject_var spSpec${attrib.name} ;

	rc = _spFeature->Set${attrib.name}(spSpec${attrib.name}) ;
<#break>
<#case "tklist_component">
<#case "tklist_specobject">
	CATListOfCATUnicodeString listStr = GetArg("-${attrib.name}") ;

	// find the string in the Part
	CATListOfCATISpecObject_var listSpec${attrib.name} ;

	rc = _spFeature->Set${attrib.name}(listSpec${attrib.name}) ;
<#break>
<#default>
	${x .type} ${x .prefix}${attrib.name}  = GetArg("-${attrib.name}") ;

	rc = _spFeature->Set${attrib.name}(${x .prefix}${attrib.name}) ;
</#switch>

	return rc ;
}
</#list>

